<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
	<tr>
		<td>
			<span style="float: left;">后台管理中心&nbsp;&raquo;&nbsp;订单管理</span>
			<span style="float: right;">
				<a href="javascript:history.go(-1);">&lt;- 返回</a>
			</span>
		</td>
	</tr>
</table>

<div align="center" style="margin-bottom: 8px;">
	<form action="./?controller=order" method="POST">
	产品
	<select name="pid">
		<option value="0">不限</option>
<?php
foreach ($this->product_info as $v)
{
	$selected = $this->pid == $v['id'] ? ' selected' : '';
	echo <<<EOF
		<option value="{$v['id']}" {$selected}>{$v['name']}</option>
EOF;
}
?>
	</select>
	&nbsp;&nbsp;
	<input type="submit" value="查询">
	</form>
</div>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
	<tr class="header">
		<td colspan="10">订单列表</td>
	</tr>
	<tr class="category" align="center">
		<td width="10%">订单号</td>
		<td width="10%">用户ID</td>
		<td width="10%">购买产品</td>
		<td width="10%">账号</td>
		<td width="10%">金额</td>
		<td width="10%">状态</td>
		<td width="10%">微信号</td>
		<td width="10%">开始时间</td>
		<td width="10%">到期时间</td>
		<td width="10%">操作</td>
	</tr>
<?php
foreach ($this->data as $row)
{
	$endtime = date('Y-m-d H:i:s',$row['endtime']);
	$status = $this->order_status[$row['status']];
	echo <<<EOF
	<tr>
		<td class="altbg1" align="center">{$row['orderid']}</td>
		<td class="altbg2" align="center">{$row['uid']}</td>
		<td class="altbg1" align="center">{$row['product']['name']}</td>
		<td class="altbg2" align="center">{$row['account']['username']}</td>
		<td class="altbg1" align="center">{$row['money']}</td>
		<td class="altbg2" align="center">{$status}</td>
		<td class="altbg1" align="center">{$row['account']['wechat']}</td>
		<td class="altbg2" align="center">{$row['paytime']}</td>
		<td class="altbg1" align="center">{$endtime}</td>
		<td class="altbg2" align="center">
		    <a href="./?controller=order&action=detail&id={$row['id']}">查看详情</a><br />
            <a href="./?controller=order&action=setunusual&id={$row['id']}">标记异常</a>
		</td>
	</tr>
EOF;
}
?>
	<tr class="category">
		<td align="center" colspan="10">
			<?php echo $this->paging; ?>
		</td>
	</tr>
</table>
